package com.zhny.sensor;

import com.zhny.sensor.config.AppConfig;
import com.zhny.sensor.config.PersistenceJPAConfig;
import com.zhny.sensor.nio.BCMNettyServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @Auther: zhy
 * @Date: 2019/11/9
 * @Description: 程序启动类
 */
@SpringBootApplication
@ComponentScan(basePackageClasses = {AppConfig.class,PersistenceJPAConfig.class})
public class App {

    private static final Logger log = LoggerFactory.getLogger(App.class);

    public static void main(String[] args) throws Exception {

        log.info("服务正在启动......");
        @SuppressWarnings("resource")
        ApplicationContext context = new AnnotationConfigApplicationContext(App.class);
        BCMNettyServer nettyServer = context.getBean(BCMNettyServer.class);
        nettyServer.run();

    }
}
